package com.monitoring.domain.valueobject;

import lombok.Value;

@Value
public class Humidity {
    private double value;
    private String unit; // percentage
    
    public Humidity(double value) {
        if (value < 0 || value > 100) {
            throw new IllegalArgumentException("Humidity value must be between 0 and 100");
        }
        this.value = value;
        this.unit = "%";
    }
    
    public boolean isHigh() {
        return value > 80;
    }
    
    public boolean isLow() {
        return value < 20;
    }
    
    public boolean isIdeal() {
        return value >= 40 && value <= 60;
    }
    
    public String getStatus() {
        if (isHigh()) return "高湿度";
        if (isLow()) return "低湿度";
        if (isIdeal()) return "理想湿度";
        return "正常湿度";
    }
}